{include file="entete.tpl"}
{literal}
<script type="text/javascript" src= "/PariGest/pages/js/prototype.js"></script>
<script type="text/javascript">
function gerePari(idxPari, etatPari)
{
  //alert(idxPari + ', ' + etatPari);
  var url = "/PariGest/pages/xmlGestionParis.php";
  var parametres = "IdCompte=" + $F("IdCompte_" + idxPari);
  parametres += "&IdOperation=" + $F("IdOperation_" + idxPari);
  parametres += "&Action=" + etatPari;
    
  lanceRequest(url, parametres, "effacePari('"+idxPari+"')");
}

function effacePari(idxPari)
{
  //alert('effacePari : ' + idxPari);
  $("Pari_" + idxPari).remove();
  alert("Il faudra faire la mise à jour des dernières op.");
}

function affichePlus(type, deplie)
{
  if( deplie )
  {
    $(type + "Plus").hide();
    $(type + "Detail").show();
    $(type + "Moins").show();
  }
  else
  {
    $(type + "Plus").show();
    $(type + "Moins").hide();
    $(type + "Detail").hide();
  }  
}

</script>
{/literal}
<span class="boite_titre">Paris en cours</span>
<table class="boite_contenu" border=0 cellspacing=5 cellpadding=0>	
{ if $NbParis == 0 }
  <tr><td>Aucun pari en cours</td></tr>
{ else }
  <tr>
    <td>Date</td>
    <td>Sport</td>
    <td>Mise</td>
    <td>Cote</td>
    <td>NbParis</td>
    <td>Combine</td>
  </tr>
  {foreach from=$LstParis item=ligne name=paris}
    {if $smarty.foreach.paris.index == 10 }
      <tr id="ParisEnCoursPlus"><td colspan="9" class="droite cursmain" onClick="affichePlus('ParisEnCours', true)">+ de résultats</td></tr>
      <tbody id="ParisEnCoursDetail" style="display:none">
    {/if}
      <tr id="Pari_{$smarty.foreach.paris.index}" title="{$ligne.Commentaire}">
        <td>
          <input type="hidden" name="IdCompte_{$smarty.foreach.paris.index}" id="IdCompte_{$smarty.foreach.paris.index}" value="{$ligne.IdCompte}">
          <input type="hidden" name="IdOperation_{$smarty.foreach.paris.index}" id="IdOperation_{$smarty.foreach.paris.index}" value="{$ligne.IdOperation}">
          {$ligne.Date|date_format:"%d/%m/%Y"}
        </td>
        <td>{$ligne.IndSport}</td>
        <td>{$ligne.Mise}</td>
        <td>{$ligne.Cote}</td>
        <td>{$ligne.NbPari}</td>
        <td>{$ligne.IndCombine}</td>
        <td title="Gagné" class="cursmain"><img onClick="gerePari('{$smarty.foreach.paris.index}', 'G')" src="/PariGest/img/icones/PariGagne.png" width="18" height="16"></td>
        <td title="Perdu" class="cursmain"><img onClick="gerePari('{$smarty.foreach.paris.index}', 'P')" src="/PariGest/img/icones/PariPerdu.png" width="18" height="16"></td>
        <td title="Annulé" class="cursmain"><img onClick="gerePari('{$smarty.foreach.paris.index}', 'A')" src="/PariGest/img/icones/PariAnnule.png" width="18" height="16"></td>
      </tr>    
  {/foreach}
    {if $smarty.foreach.paris.index >= 10 } 
      <tr id="ParisEnCoursMoins"><td colspan="9" class="droite cursmain" onClick="affichePlus('ParisEnCours', false)">- de résultats</td></tr>
      </tbody>
    {/if}              
{/if}
</table>
<input type="hidden" name="NbParis" value="{$NbParis}">
